package com.commerceerp.system.service.Impl;

import com.commerceerp.system.entity.PushGoodInfo;
import com.commerceerp.system.mapper.PushGoodMapper;
import com.commerceerp.system.service.PushGoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PushGoodServiceImpl implements PushGoodService {

    @Autowired
    private PushGoodMapper pushGoodMapper;


    @Override
    public List<Map> getAllPushGoodByStatus(PushGoodInfo pushGoodInfo) {

        List<Map> pgInfos = pushGoodMapper.getAllPushGoodByStatus(pushGoodInfo);

        return pgInfos;
    }

    @Override
    public Integer updPushGoodById(PushGoodInfo pushGoodInfo) {

        Integer success = pushGoodMapper.updPushGoodById(pushGoodInfo);

        return success;
    }

    @Override
    public PushGoodInfo getPushGoodBuPgId(String pgId) {

        PushGoodInfo pgInfo = pushGoodMapper.getPushGoodBuPgId(pgId);

        return pgInfo;

    }

    @Override
    public Integer delPushGoodById(String pgId) {

        Integer success = pushGoodMapper.delPushGoodById(pgId);

        return success;
    }

    @Override
    public Integer saveNewPushGood(PushGoodInfo pushGoodInfo) {

        Integer success = pushGoodMapper.saveNewPushGood(pushGoodInfo);

        return success;
    }

    @Override
    public List<Map> getCountByPgStatus() {

        List<Map> list = this.pushGoodMapper.getCountByPgStatus();

        return list;
    }
}
